using System;
using System.Threading.Tasks;
using Terra.Data.Entities.Identity;

namespace Terra.Data.Repository.Identity;

/// <summary>
/// 刷新令牌仓储接口
/// </summary>
public interface IRefreshTokenRepository : IRepository<RefreshToken, Guid>
{
    /// <summary>
    /// 根据令牌值查找刷新令牌
    /// </summary>
    Task<RefreshToken> FindByTokenAsync(string token);

    /// <summary>
    /// 撤销用户的所有刷新令牌
    /// </summary>
    Task RevokeAllAsync(Guid userId);

    /// <summary>
    /// 撤销指定的刷新令牌
    /// </summary>
    Task RevokeAsync(string token);
}